{%include file="m.index.header.tpl.php"%}
<!--头部 end--> 
<!--主体部分-->
<form name="myform" action="" method="get">
<div class="container" style="margin-top:70px;">
  <div class="row" style="margin-top:10px;">
    <div class="col-sm-12 distance" >
      <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">学年学期:</label>
        <div class="col-sm-10">
          <select class="form-control" id="semester_id" name="semester_id">
				  <option value="">请选择</option>
				{%foreach from=$semester_lists key=key item=value%}
				  <option value="{%$key%}"{%if $key==$semester_id%}selected{%/if%}>
				  {%$value%}</option>
				{%/foreach%}
		  </select>
        </div>
      </div>
    </div>
    <div class="col-sm-12 distance" >
      <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">学月:</label>
        <div class="col-sm-10">
          <select class="form-control" name="attend_smonth" id="semester_month">
				  <option value="">请选择</option>
				{%foreach from=$month_lists key=key item=value%}
				  <option value="{%$key%}"{%if $key==$attend_smonth%}selected{%/if%}>
				  {%$key%}</option>
				{%/foreach%}
		  </select>
        </div>
      </div>
    </div>
    <div class="col-xs-12 distance"   >
      <div class="form-group text-center" style="padding-top:0px;">
	    <input type="hidden" name="a" value="attend.list">
        <button type="submit"  class="btn btn-primary" style="width:70%">搜索</button>
      </div>
    </div>
  </div>
  <div class="row" style="margin-top:15px;margin-left:1px; margin-right:1px;">
    <h5 class="text-center" style="color:red">{%$semester_data.semester_name%}第{%$attend_smonth%}学月教师考勤表</h5>
	{%foreach from=$attend_lists key=key item=value%}
    <table class="table table-striped table-bordered text-center"  id="middles">
      <tr>
        <td>编号</td>
        <td>{%$value.staff_id%}</td>
      </tr>
      <tr>
        <td>教师姓名</td>
        <td>{%$value.staff_name%}</td>
      </tr>
      <tr>
        <td>迟到</td>
        <td>{%$value.attend_a%}</td>
      </tr>
      <tr>
        <td>早退</td>
        <td>{%$value.attend_b%}</td>
      </tr>
      <tr>
        <td>病假</td>
        <td>{%$value.attend_c%}</td>
      </tr>
      <tr>
        <td>事假</td>
        <td>{%$value.attend_d%}</td>
      </tr>
      <tr>
        <td>公假</td>
        <td>{%$value.attend_e%}</td>
      </tr>
      <tr>
        <td>婚假</td>
        <td>{%$value.attend_f%}</td>
      </tr>
      <tr>
        <td>产假</td>
        <td>{%$value.attend_g%}</td>
      </tr>
      <tr>
        <td>丧假</td>
        <td>{%$value.attend_h%}</td>
      </tr>
      <tr>
        <td>旷工</td>
        <td>{%$value.attend_i%}</td>
      </tr>
      <tr>
        <td>备注</td>
        <td>{%$value.attend_content%}</td>
      </tr>
      <tr>
        <td>录入时间</td>
        <td>{%$value.create_time%}</td>
      </tr>
    </table>
   {%/foreach%}
  </div>
</div>
<!--container  end--> 
<!--主体部分  end--> 
<!--底部-->
{%include file="m.index.footer.tpl.php"%} 
<!--      二级联动     -->
<script type="text/javascript">
        $(document).ready(function () {
            $("#semester_id").change(function () {		
                if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=semester.monthjson",
			type:"get",
			data: "semester_id=" + $("#semester_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
			   
					//实例2个字符串变量来拼接下拉列表
					var industr = "";
					//使用jquery解析json中的数据
					$.each(msg, function (n, value) {
						industr += ("<option value=\"" + value.semester_month + "\">" + value.semester_month);
						industr += ("</option>");
					});

					$("#semester_month").html(industr);			   			   
			}
			});					

                }

            });

        });
</script>

